<?php

use yii\db\Migration;
use yii\db\Schema;

class m170901_014459_CREATE_TABLE_RECEIVE_ACCOUNT extends Migration
{
    public function up()
    {
        $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
        // 财务接收账号表 
        $this->createTable('receive_account', [
            "id" =>         Schema::TYPE_PK,
            "account" =>   	Schema::TYPE_STRING.    "(255) NOT NULL COMMENT '收款账号'",
            "remark" =>     Schema::TYPE_STRING.    "(255) NULL COMMENT '备注描述'",
            "user_id" =>    Schema::TYPE_INTEGER.   "(10) DEFAULT '0' COMMENT '管理员编号'",
            "created_at" => Schema::TYPE_DATETIME.  " NULL",
            "updated_at" => Schema::TYPE_TIMESTAMP. " NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP",
        ], $tableOptions);


    }

    public function down()
    {
        echo "m170901_014459_CREATE_TABLE_RECEIVE_ACCOUNT cannot be reverted.\n";

        return false;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
